Repository navigation
Fix kernel launches over more than INT_MAX work-items with DPC++ 2026.2 - #3089
Merged
Merged
Conversation
Starting with DPC++ 2026.2 the ID-queries range is recorded in the device image during the device link step. With the option passed only at compile time, the link step falls back to the default int range and kernels launched over more than INT_MAX work-items raise a RuntimeError.
antonwolfy
requested review from
ndgrigorian and
vlad-perevezentsev
as code owners
October 7, 2026 13:13
Contributor
|
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
Collaborator
Contributor
|
Array API standard conformance tests for dpnp=0.21.0dev13=np2py314h8d9cdd5_10 ran successfully. |
4 of 7 tasks
vlad-perevezentsev
self-requested a review
October 13, 2026 15:10
vlad-perevezentsev
approved these changes
Oct 13, 2026
vlad-perevezentsev
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Thank you @antonwolfy
github-actions Bot
added a commit
that referenced
this pull request
Oct 13, 2026
….2 (#3089) This PR fixes a `RuntimeError` raised by kernels launched over more than `INT_MAX` work-items when dpnp is built with DPC++ compiler 2026.2: ``` RuntimeError: The kernel was compiled with -fsycl-id-queries-range=int, but the provided range/offset exceeds the maximum value storable in an int. Either reduce the range/offset or recompile the kernel with -fsycl-id-queries-range=[uint|size_t]. ``` It affects operations on arrays with more than `2**31` elements that go through a strided kernel, e.g. copying a broadcast view, `dpnp.take`, advanced indexing, `dpnp.choose` and assignment through `__setitem__`. Builds with DPC++ 2026.1 are not affected. Starting with 2026.2, the range a kernel assumes for its work-item IDs is recorded in the device image at the device link step, and the SYCL runtime checks each launch against it. dpnp passed `-fno-sycl-id-queries-fit-in-int` only at compile time, so the link step recorded the default `int` range even though the device code was built for `size_t`. The existing option spelling is kept because both 2026.1 and 2026.2 accept it. The third party tests for arrays with more than `2**31` elements are updated: - `TestHugeArrays`: new `test_take_negative_index_at_int32_size_boundary`, which uses a broadcast view, needs no real allocation and runs by default; reworked `test_take_array` and `test_take_scalar` - new `TestTriLargeDimensions` for `dpnp.tri` with more than `2**31` rows or columns - added tests that depend on implementation-internal kernels are marked as skipped Validated with DPC++ 2026.2 on Intel Data Center GPU Max 1100 (Level Zero) and on CPU (OpenCL), running the slow tests with `-m slow`; results are the same on both devices: | Test | Before | After | |---|---|---| | `TestHugeArrays::test_advanced` | failed | passed | | `TestHugeArrays::test_take_array` | failed | passed | | `TestHugeArrays::test_take_scalar` | failed | passed | | `TestHugeArrays::test_choose` | failed | passed | | `TestTriLargeDimensions` (2 tests) | passed | passed | The default (non-slow) run of the changed test files passes on both devices, and the build has no new warnings. 98d14dd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a
RuntimeErrorraised by kernels launched over more thanINT_MAXwork-items when dpnp is built with DPC++ compiler 2026.2:It affects operations on arrays with more than
2**31elements that go through a strided kernel, e.g. copying a broadcast view,dpnp.take, advanced indexing,dpnp.chooseand assignment through__setitem__. Builds with DPC++ 2026.1 are not affected.Starting with 2026.2, the range a kernel assumes for its work-item IDs is recorded in the device image at the device link step, and the SYCL runtime checks each launch against it. dpnp passed
-fno-sycl-id-queries-fit-in-intonly at compile time, so the link step recorded the defaultintrange even though the device code was built forsize_t.The existing option spelling is kept because both 2026.1 and 2026.2 accept it.
The third party tests for arrays with more than
2**31elements are updated:TestHugeArrays: newtest_take_negative_index_at_int32_size_boundary, which uses a broadcast view, needs no real allocation and runs by default; reworkedtest_take_arrayandtest_take_scalarTestTriLargeDimensionsfordpnp.triwith more than2**31rows or columnsValidated with DPC++ 2026.2 on Intel Data Center GPU Max 1100 (Level Zero) and on CPU (OpenCL), running the slow tests with
-m slow; results are the same on both devices:TestHugeArrays::test_advancedTestHugeArrays::test_take_arrayTestHugeArrays::test_take_scalarTestHugeArrays::test_chooseTestTriLargeDimensions(2 tests)The default (non-slow) run of the changed test files passes on both devices, and the build has no new warnings.